<?php
include 'illparse.php';
include 'weather.php';

if($_POST["user"] != "") {
	session_id($_POST["session"]);
	session_start();

	$t = $_POST["user"];
	if (strpos($t, "weather") !== false) {
		echo getWeather(substr($t, strpos($t, ' ')+1));
	}
	else if (strpos($t, "ill") !== false) {
		echo getIllness();
	}
	else if (strpos($t, "yes") !== false) {
		if ($_SESSION['fevermode'] == 1) {
			echo hasSymptom();
		}
	}
	else if (strpos($t, "no") !== false) {
		echo getIllness($_POST["session"]);
	}
	else {
		echo "I don't understand \"".$t."\"";
	}
}
?>
